﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RelationExpertSystem.Relation
{
    public class Spouse : RelationBase
    {
        private static Spouse _singleton = new Spouse();
        public static Spouse Instance
        {
            get { return _singleton; }
        }

        private Spouse() { }

        public override bool IsRelated(Person a, Person b)
        {
            // b is a's spouse IFF a is b's spouse OR DEFINED
            return a == b.Spouse || b == a.Spouse;
        }

        public override IEnumerable<IRelation> GetDependencies()
        {
            //return new HashSet<IRelation>(new IRelation[] { Spouse.Instance });
            return new HashSet<IRelation>();
        }
    }
}
